{extend name='main'}

{block name="button"}
<!--{if auth("unlock")}-->
<!--<button data-action='{:url("unlock")}' data-title="打开箱格" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>打开箱格</button>-->
<!--{/if}-->
<!--{if auth("add")}-->
<button data-modal='{:url("add")}' data-title="添加箱格" class='layui-btn layui-btn-sm layui-btn-primary'>添加箱格</button>
<!--{/if}-->
<!--{if auth("remove")}-->
<a data-confirm="确定要删除这些箱格吗？" data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" class='layui-btn layui-btn-sm layui-btn-primary'>删除箱格</a>
<!--{/if}-->
{/block}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white table-block">
    <div class="layui-tab-content think-box-shadow table-block table-block">
        {include file='boxs/index_search'}
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th class='text-left nowrap'>设备名称</th>
                <th class='text-left nowrap'>版号通道</th>
                <th class='text-left nowrap'>箱门编号</th>
                <th class='text-left nowrap'>箱格类型</th>
                <th class='text-left nowrap'>锁状态</th>
                <th class='text-left nowrap'>状态</th>
                <th class='text-left nowrap'>使用人身份</th>
                <th class='text-left nowrap'>使用者</th>
                <th class='text-left nowrap'>备注</th>
                <!--{if auth("add")}-->
                <th>操作</th>
                <!--{/if}-->
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr data-dbclick>
                <td class='list-table-check-td think-checkbox'>
                    <label><input class="list-check-box" value='{$vo.id}' type='checkbox'> {$vo.id}</label>
                </td>
                <td class="nowrap">{$vo.device_name|default=''}</td>
                <td class="nowrap">{$vo.device_board|default=''} - {$vo.board_channel<10?'0'.$vo.board_channel:$vo.board_channel}</td>
                <td class="nowrap">{$vo.box_num|default=''}</td>
                <td class="nowrap">{$box_types[$vo.box_type]|default=''}</td>
                <td class="nowrap">{$vo.is_lock|default='未知'}</td>
                <td class="nowrap">{$box_status[$vo.box_status]|default=''}</td>
                <td class="nowrap">{if $vo.user_type}<font color="red">系统</font>{else}普通{/if}</td>
                <td class="nowrap">{$vo.user_id|default=''}</td>
                <td class="nowrap">{$vo.remark|default=''}</td>
                <!--{if auth("add")}-->
                <td class='text-left nowrap'>
                    <!--{if auth("edit")}-->
                    <a class="layui-btn layui-btn-sm layui-btn-normal" data-title="开锁" data-value="id#{$vo.d_id};box_id#{$vo.id};ch#{$vo.board_channel};device_board#{$vo.device_board}"  data-action='{:url("unlock")}'>开 锁</a>

<!--                    <a class="layui-btn layui-btn-sm layui-btn-normal" data-title="开锁" data-value="id#{$vo.id};"  data-action='{:url("clears")}'>清除占用</a>-->
                    <!--{/if}-->
                    <!--{if auth("edit")}-->
                    <a class="layui-btn layui-btn-sm" deta-area="['800px','600px']" data-title="编辑" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                    <!--{/if}-->
                    <!--{if auth("remove")}-->
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除此箱格吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                    <!--{/if}-->
                </td>
                <!--{/if}-->
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>
{/block}
